<html>

<head>
<title>RCP EditorPart Wizard</title>
<link href="../../../book.css" rel="stylesheet" type="text/css">
</head>

<body>

<h1>RCP EditorPart Wizard</h1>

<table border="0" cellpadding="0" cellspacing="0" width="700">
  <tr>
    <td><img src="images/wizard_rcp_editorpart0.gif" align="left" hspace="10">Subclasses of the Eclipse RCP <b>EditorPart</b> class can be
              created using the <b>RCP EditorPart </b>wizard. The wizard can be
              selected from the drop down Designer wizard menu or from the
              Eclipse <b>New</b> wizard.
              <p>To use the wizard, select the project source folder and package
              to contain the class. Then enter the class name and editor name and hit the <b>Finish</b>
              button.</td>
  </tr>
  <tr>
    <td><br>
	<img src="images/wizard_rcp_editorpart1.gif">&nbsp;
      <img src="images/wizard_rcp_editorpart2.gif"></td>
  </tr>
  <tr>
    <td>
    <p><br>
	The wizard generates the following code.</p>
      <blockquote>
              <dl>
                <dt><font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> </font>
				<font face="Courier New" size="2">org.eclipse.core.runtime.IProgressMonitor;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> </font>
				<font face="Courier New" size="2">org.eclipse.swt.SWT;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> </font>
				<font face="Courier New" size="2">org.eclipse.swt.widgets.Composite;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> </font>
				<font face="Courier New" size="2">org.eclipse.ui.IEditorInput;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> </font>
				<font face="Courier New" size="2">org.eclipse.ui.IEditorSite;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> </font>
				<font face="Courier New" size="2">org.eclipse.ui.PartInitException;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font SIZE="2" COLOR="#7f0055"><b><font face="Courier">import</font></b></font><font face="Courier" SIZE="2"> </font>
				<font face="Courier New" size="2">org.eclipse.ui.part.EditorPart;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier" size="2" color="#7f0055"><b>public class</b></font><font face="Courier New" size="2"> EclipseEditorPartTest
                  </font><font face="Courier" size="2" color="#7f0055"><b>extends</b></font><font face="Courier New" size="2"> EditorPart {<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; </font>
				<font face="Courier" size="2" color="#7f0055"><b>public static 
				final</b></font><font face="Courier New" size="2"> String ID =
				</font><font size="2" color="#2a00ff" face="Courier">&quot;com.test.RcpEditorPart&quot;</font><font face="Courier New" size="2">;
				</font><font face="Courier" size="2" color="#3f7f5f">
				//$NON-NLS-1$</font></dt>
				<dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
                  </font><font face="Courier" size="2" color="#7f0055"><b>public</b></font><font face="Courier New" size="2"> 
				RcpEditorPart() {<br>
&nbsp;&nbsp;&nbsp; }</font></dt>
				<dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; </font>
				<font size="2" color="#646464" face="Courier">@Override</font><font face="Courier" size="2" color="#3f7f5f"><br>
				</font><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
                  </font><font face="Courier" size="2" color="#7f0055"><b>public
                  void</b></font><font face="Courier New" size="2"> createPartControl(Composite parent) {<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
                  &nbsp;&nbsp;&nbsp;&nbsp;Composite container = 
                  </font><font face="Courier" size="2" color="#7f0055"><b>new</b></font><font face="Courier New" size="2"> Composite(parent, SWT.</font><font size="2" color="#0000c0" face="Courier"><i>NONE</i></font><font face="Courier New" size="2">);<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; }<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; </font>
				<font size="2" color="#646464" face="Courier">@Override</font><font face="Courier" size="2" color="#3f7f5f"><br>
				</font><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 
                  </font><font face="Courier" size="2" color="#7f0055"><b>public
                  void</b></font><font face="Courier New" size="2"> setFocus() {<o:p>
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  </o:p>
                  </font><font color="#3f7f5f" face="Courier" size="2">// Set 
				the focus</font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; }<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; </font>
				<font size="2" color="#646464" face="Courier">@Override</font><font face="Courier" size="2" color="#3f7f5f"><br>
				</font><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 
                  </font><font face="Courier" size="2" color="#7f0055"><b>public
                  void</b></font><font face="Courier New" size="2"> doSave(IProgressMonitor monitor) {<o:p>
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  </o:p>
                  </font><font color="#3f7f5f" face="Courier" size="2">// Do the 
				Save operation</font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; }<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; </font>
				<font size="2" color="#646464" face="Courier">@Override</font><font face="Courier" size="2" color="#3f7f5f"><br>
				</font><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 
                  </font><font face="Courier" size="2" color="#7f0055"><b>public
                  void</b></font><font face="Courier New" size="2"> doSaveAs() {<o:p>
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  </o:p>
                  </font><font color="#3f7f5f" face="Courier" size="2">// Do the 
				Save As operation</font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; }<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; </font>
				<font size="2" color="#646464" face="Courier">@Override</font><font face="Courier" size="2" color="#3f7f5f"><br>
				</font><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 
                  </font><font face="Courier" size="2" color="#7f0055"><b>public
                  void</b></font><font face="Courier New" size="2"> init(IEditorSite site, IEditorInput input)<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp;
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font face="Courier" size="2" color="#7f0055"><b>throws</b></font><font face="Courier New" size="2"> PartInitException {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  </font><font color="#3f7f5f" face="Courier" size="2">// 
				Initialize the editor part</font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; }<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; </font>
				<font size="2" color="#646464" face="Courier">@Override</font><font face="Courier" size="2" color="#3f7f5f"><br>
				</font><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 
                  </font><font face="Courier" size="2" color="#7f0055"><b>public boolean</b></font><font face="Courier New" size="2"> isDirty() {<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</font><font face="Courier" size="2" color="#7f0055"><b>return 
				false</b></font><font face="Courier New" size="2">;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; }<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; </font>
				<font size="2" color="#646464" face="Courier">@Override</font><font face="Courier" size="2" color="#3f7f5f"><br>
				</font><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; 
                  </font><font face="Courier" size="2" color="#7f0055"><b>public boolean</b></font><font face="Courier New" size="2"> isSaveAsAllowed() {<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;</font><font face="Courier" size="2" color="#7f0055"><b>return 
				false</b></font><font face="Courier New" size="2">;<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">&nbsp;&nbsp;&nbsp; }<o:p>
                  </o:p>
                  </font></dt>
                <dt><font face="Courier New" size="2">}</font></dt>
              </dl>
      </blockquote>
      <p>When editing RCP EditorParts, all of the standard SWT layouts, 
		containers and widgets are available.</p>
      <p>If the EditorPart is created in an existing plugin project, the 
		plugin.xml file is also updated with the appropriate editor declaration.</p>
	<p>
		<img border="0" src="images/wizard_rcp_editorpart3.gif"></p>
    </td>
  </tr>
</table>
</body>
</html>
